<extend name="Index/index"/>

<block name="register">
    <script src="__PUBLIC__/Home/js/leftTime.min.js" ></script>
    <div class="container mt50" style="margin-top: 20px;border: 0;">
        <div class="row">
            <div class="col-md-12 ">
                <div class="thumbnail">
                    <img src="__ROOT__/Public/Home/images/banner.jpg">
                </div>
            </div>
            <!--//图片-->
            <div class="col-md-4 pull-left">
                <div class="thumbnail">
                    <img id="big" src="{{:get_img_url('__ROOT__/Uploads/GoodsImg/',$goodsDeatil['img'],350)}}">
                    <div class="row mt10">
                        <ul>
                            <!--最多显示5个缩略图-->
                            <php>$i=0;</php>
                            <foreach name="goodsImgDeatil" item="item">
                                <if condition="$i elt 4">
                                    <li class="col-md-2">
                                        <img class="pic" onmousemove="changesrc(this)" src="{{:get_img_url('__ROOT__/Uploads/GoodsImg/',$item['img'],50)}}">
                                    </li>
                                </if>
                            </foreach>



                        </ul>
                    </div>
                </div>
            </div><!--pull-left end-->

            <div class="col-md-7 pull-right">
                <!--商品名字和详细信息-->
                <div class="row">
                    <p><b style="font-size: 20px">{{$goodsDeatil.name}}</b></p>
                    <br>
                    <p class="text-danger">{{$goodsDeatil.msg}}</p>
                </div>
                <!--商品价格-->
                <if condition="$goods_type['goods_type'] eq '1'">
<!--抢购商品-->
                         <div class="row mt10" style="margin-left: -28px">
                                <h3 class="col-md-6 price">抢购价:&nbsp;&nbsp;
                                    <span class="glyphicon glyphicon-jpy" style="color: #f78d03;font-size: 25px;"></span>
                                    <span style="color: #f78d03;font-size: 25px;">{{$goods_seckill.seck_pri}}</span>
                                    <span style="color: #c2ccd1;font-size: 15px;"><s>原价:{{$goodsDeatil.price}}</s></span>
                                </h3>
                         </div>
                        <!--抢购倒计时-->
                    <div class="row mt10 coupon" style="margin-left: -28px">
                                <tr>
                                    <td class="colspan-a">
                                        <div class="data-show-box" id="dateShow1">
                                            <h3 class="col-md-9 price">抢购倒计时:&nbsp;&nbsp;
                                                <span class="date-tiem-span d">00</span>天
                                                <span class="date-tiem-span h">00</span>时
                                                <span class="date-tiem-span m">00</span>分
                                                <span class="date-s-span s">00</span>秒
                                            </h3>
                                        </div>
                                    </td>
                                </tr>
                        </div>
                        <!--抢购倒计时-->
                        <script type="text/javascript">
                            $(function(){
                                //日期倒计时
                                $.leftTime("{{$goods_seckill[end_time]}}",function(d){
                                    if(d.status){
                                        var $dateShow1=$("#dateShow1");
                                        $dateShow1.find(".d").html(d.d);
                                        $dateShow1.find(".h").html(d.h);
                                        $dateShow1.find(".m").html(d.m);
                                        $dateShow1.find(".s").html(d.s);
                                    }
                                });
                            });
                        </script>
                        <!--商品数量-->
                        <br>
                        <form action="{{:U('User/addCart')}}" method="post" style="margin-left: -28px">
                            <input type="hidden" name="goods_type" value="1">
                            <input type="hidden" name="goods_id" value="{{$goodsDeatil.id}}">
                            <input type="hidden" name="goods_name" value="{{$goodsDeatil.name}}">
                            <input type="hidden" name="price" value="{{$goods_seckill.seck_pri}}">
                            <!--商品库存-->
                            <input type="hidden" name="qty" value="1">
                            <h3 class="col-md-3 price">限购数量: 1 </h3>

                            <h3 class="col-md-3 price">库存:{{$goodsDeatil.num}}</h3>
                            <h3 class="col-md-3 price">销量:{{$goodsDeatil.sales_num}}</h3>
                            <br><br><br>
                            <h3 class="col-md-12 price">
                                <button class="btn btn-success" type="submit" name="act" value="buy">立即购买</button>
                                <button class="btn btn-danger" type="submit" name="act" value="add_cart">加入购入车</button>
                            </h3>

                        </form>
                    <elseif condition="$goods_type['goods_type'] eq '2'"/>
<!--团购商品-->
                        <div class="row mt10" style="margin-left: -28px">
                            <h3 class="col-md-6 price">团购价:&nbsp;&nbsp;
                                <span class="glyphicon glyphicon-jpy" style="color: #f78d03;font-size: 25px;"></span>
                                <span style="color: #f78d03;font-size: 25px;">{{$goods_group.gprice}}</span>
                                <span style="color: #c2ccd1;font-size: 15px;" ><s>原价:{{$goodsDeatil.price}}</s></span>
                            </h3>
                        </div>
                        <!--商品优惠券-->
                        <!--<div class="row mt10 coupon" style="margin-left: -28px">-->
                            <!--<form action="{{:U('User/getCoupon')}}" method="get">-->
                                <!--<input type="hidden" name="goods_type" value="1">-->

                                <!--<h3 class="col-md-9 price">优惠券:&nbsp;&nbsp;-->
                                    <!--<select name="coupon_id" >-->
                                        <!--<foreach name="couponList" item="value">-->
                                            <!--<option value="{{$value.id}}">{{$value.name}}</option>-->
                                        <!--</foreach>-->
                                    <!--</select>-->
                                <!--</h3>-->
                                <!--<h3 class="col-md-3 price">-->
                                    <!--<h3><input type="submit" value="领取"></h3></a>-->
                                <!--</h3>-->
                            <!--</form>-->
                        <!--</div>-->
                        <!--商品数量-->
                        <br>
                        <form action="{{:U('User/addCart')}}" method="post" style="margin-left: -28px">
                            <input type="hidden" name="uid" value="{{$uid}}">
                            <input type="hidden" name="goods_type" value="2">
                            <input type="hidden" name="goods_id" value="{{$goodsDeatil.id}}">
                            <input type="hidden" name="goods_name" value="{{$goodsDeatil.name}}">
                            <input type="hidden" name="price" value="{{$goods_group.gprice}}">
                            <!--商品库存-->
                            <input type="hidden" name="num" value="{{$goodsDeatil.num}}">
                            <input type="hidden" name="qty" value="1">
                            <h3 class="col-md-3 price">限购数量: 1 </h3>
                            <!--<h3 class="col-md-2 price">数量:</h3>-->
                            <!--<h4 class="col-md-4 price">-->
                                <!--<div class="col-md-3 btn btn-default" onclick="minus()">▬</div>-->
                                <!--<div class="col-md-6">-->
                                    <!--<input type="number" name="qty" value="1" id="qty" class="form-control text-center">-->
                                <!--</div>-->
                                <!--<div class="col-md-3 btn btn-default" onclick="plus()">✚</div>-->
                            </h4>
                            <h3 class="col-md-3 price">库存:{{$goodsDeatil.num}}</h3>
                            <h3 class="col-md-3 price">销量:{{$goodsDeatil.sales_num}}</h3>
                            <br><br><br>
                            <h3 class="col-md-12 price">
                                <button class="btn btn-success" type="submit" name="act" value="buy">立即购买</button>
                                <button class="btn btn-danger" type="submit" name="act" value="add_cart">加入购入车</button>
                            </h3>

                        </form>
                    <else />
<!--普通商品-->
                        <div class="row mt10" style="margin-left: -28px">
                            <h3 class="col-md-6 price">价格:&nbsp;&nbsp;
                                <span class="glyphicon glyphicon-jpy" style="color: #f78d03;font-size: 25px;"></span>
                                <span style="color: #f78d03;font-size: 25px;">{{$goodsDeatil.price}}</span>
                            </h3>
                        </div>
                        <!--商品优惠券-->
                        <div class="row mt10 coupon" style="margin-left: -28px">
                            <form action="{{:U('User/getCoupon')}}" method="get">
                                <h3 class="col-md-9 price">优惠券:&nbsp;&nbsp;
                                    <select name="coupon_id" >
                                        <foreach name="couponList" item="value">
                                            <option value="{{$value.id}}">{{$value.name}}</option>
                                        </foreach>
                                    </select>
                                </h3>
                                <h3 class="col-md-3 price">
                                    <h3><input type="submit" value="领取"></h3></a>
                                </h3>
                            </form>
                        </div>
                        <!--商品数量-->
                        <br>
                        <form action="{{:U('User/addCart')}}" method="post" style="margin-left: -28px">
                            <input type="hidden" name="goods_type" value="0">
                            <input type="hidden" name="goods_id" value="{{$goodsDeatil.id}}">
                            <input type="hidden" name="goods_name" value="{{$goodsDeatil.name}}">
                            <input type="hidden" name="price" value="{{$goodsDeatil.price}}">
                            <!--商品库存-->
                            <input type="hidden" name="num" value="{{$goodsDeatil.num}}">
                            <h3 class="col-md-2 price">数量:</h3>
                            <h4 class="col-md-4 price">
                                <div class="col-md-3 btn btn-default" onclick="minus()">▬</div>
                                <div class="col-md-6">
                                    <input type="number" name="qty" value="1" id="qty" class="form-control text-center">
                                </div>
                                <div class="col-md-3 btn btn-default" onclick="plus()">✚</div>
                            </h4>
                            <h3 class="col-md-3 price">库存:{{$goodsDeatil.num}}</h3>
                            <h3 class="col-md-3 price">销量:{{$goodsDeatil.sales_num}}</h3>
                            <br><br><br>
                            <h3 class="col-md-12 price">
                                <button class="btn btn-success" type="submit" name="act" value="buy">立即购买</button>
                                <button class="btn btn-danger" type="submit" name="act" value="add_cart">加入购入车</button>
                            </h3>

                        </form>
                </if>
            </div>

            <!--pull-right end-->
        </div><!--row end-->
        <div class="row mt20">
            <div class="layui-tab">
                <ul class="layui-tab-title">
                    <li class="layui-this">产品详情</li>
                    <li>累计评价({{$evatot}})</li>
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show text-center">
                        <foreach name="goodsImgDeatil" item="item">
                                <div style="text-align: center">
                                    <img class="pic"  src="{{:get_img_url('__ROOT__/Uploads/GoodsImg/',$item['img'],350)}}" style="width: 500px;">
                                </div>
                        </foreach>


                    </div>
                    <div class="layui-tab-item">
                        <if condition="$queryeva eq null">
                            <div class="tr non-info  border-bottom-none">
                                <span>暂时没有评论</span>
                            </div>
                            <else />
                            <table class="layui-table">
                                <colgroup>
                                    <col >
                                    <col >
                                    <col>
                                </colgroup>
                                <thead>
                                <tr>
                                    <th >用户名</th>
                                    <th>评价时间</th>
                                    <th >评价内容</th>
                                    <th >相符程度</th>
                                </tr>
                                </thead>
                                <tbody>
                                <foreach name="queryeva" item="vo" key="k">
                                    <tr>
                                        <td>{{$vo.name}}</td>
                                        <td>{{$vo.create_time}}</td>
                                        <td>{{$vo.msg}}</td>
                                        <td class="pj-b">
                                            <if condition="$vo['grade'] eq '1'">
                                                <i class="layui-icon">&#xe600;</i>
                                            <elseif condition="$vo['grade'] eq '2'"/>
                                                <i class="layui-icon">&#xe600;</i><i class="layui-icon">&#xe600;</i>
                                            <elseif condition="$vo['grade'] eq '3'"/>
                                                <i class="layui-icon">&#xe600;</i><i class="layui-icon">&#xe600;</i><i class="layui-icon">&#xe600;</i>

                                            <elseif condition="$vo['grade'] eq '4'"/>
                                                <i class="layui-icon">&#xe600;</i><i class="layui-icon">&#xe600;</i><i class="layui-icon">&#xe600;</i><i class="layui-icon">&#xe600;</i>
                                            <elseif condition="$vo['grade'] eq '5'"/>
                                                <i class="layui-icon">&#xe600;</i><i class="layui-icon">&#xe600;</i><i class="layui-icon">&#xe600;</i><i class="layui-icon">&#xe600;</i><i class="layui-icon">&#xe600;</i>
                                                <else /> 0
                                            </if>

                                        </td>
                                    </tr>
                                </foreach>

                                </tbody>
                            </table>
                        </if>

                    </div>
                </div>
            </div>

            <script>
                //注意：选项卡 依赖 element 模块，否则无法进行功能性操作
                layui.use('element', function(){
                    var element = layui.element;

                    //…
                });
            </script>


        </div>
    </div><!--container end-->

    <script src="__PUBLIC__/Home/js/home.js"></script>
    <link rel="stylesheet" href="__PUBLIC__/Home/css/home.css">
</block>